@use '../partials/mixin' as mx;

.CSS_START_components_readerHeader {
    display: none;
}

[data-theme="dark"] {
    .toolbar_navigation, .picker_container {
        background-color: var(--color-neutral-base);
        // border-bottom: 2px solid var(--color-gray-800);
    }
}

[data-theme="system"] {
    @media (prefers-color-scheme: dark) {
        .toolbar_navigation, .picker_container {
        background-color: var(--color-neutral-base);
        // border-bottom: 2px solid var(--color-gray-800);
        }
    }
}

.toolbar_navigation {
    height: 70px;
    width: 100%;
    padding: 0;
    background-color: var(--color-gray-50);
    border-bottom: 3px solid var(--color-gray-100);
    box-sizing: border-box;

    &.ttsAudioActivated .tts_toolbar::before {
            content: "";
            position: absolute;
            left: calc(50% - 105px);
            top: 42px;
            height: 1px;
            width: 210px;  /* or 100px */
            border-bottom: 2px solid var(--color-brand-primary);
    }

    > ul {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: inherit;
        margin: 0;
        list-style-type: none;
        padding: 0 20px;

        .tts_toolbar {
            justify-content: center;
            position: relative;

            @media screen and (width <= 850px) {
                margin-right: 10px;
            }

        }

        .menu_option {
            justify-content: end;
            gap: 10px;
        }

        .pdf_options {
            max-width: 100px;
        }

        li {
            height: 40px;
            width: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 5px;

            &:has(input:disabled) {
                .menu_button {
                    background-color: transparent;
                    cursor:auto;

                    &:not(:has(.active_svg)):hover,
                    &:not(:has(.active_svg)):focus {
                        border-color: transparent;
                        background-color: transparent;
                    }

                    svg {
                    fill: var(--color-gray-400);
                    color: var(--color-gray-400);
                    }
                }
            }

            .my_combobox_container {
                width: unset;
            }

            .menu_button {
                height: 42px;
                width: 42px;
                cursor: pointer;
                padding: 5px;
                box-sizing: border-box;
                display: flex;
                align-items: center;
                justify-content: center;
                border: 1px solid transparent;
                transition: .2s;
                border-radius: 5px;

                &:not(:has(.active_svg)):hover {
                    border-color: var(--color-brand-primary);
                    background-color: var(--color-brand-secondary);
                }

                svg {
                    height: 20px;
                    width: 30px;
                    fill: var(--color-brand-primary-inverse);
                    color: var(--color-brand-primary-inverse);

                    // @media (prefers-color-scheme: dark) {
                    //     fill: #FEFEFE;
                    //     color: #FEFEFE;
                    // }
                }
            }

            input {
                position: relative;
                opacity: 0;
            }

            label {
                position: absolute;
                display: block;
                align-items: center;


                svg {
                    width: inherit;
                    height: inherit;
                    fill: var(--color-brand-primary);
                }
            }
        }

        > ul {
            display: flex;
            padding: 0;
            flex: 1;
            gap: 5px;
        }
    }
}

.active_svg {
    fill: var(--color-neutral-base)!important;
    color: var(--color-neutral-base)!important;

    // @media (prefers-color-scheme: dark) {
    //     fill: black!important;
    //     color: black!important;
    // }
}

.picker_container {
    display: flex;
    align-items: center;
    padding: 0;
    width: 100vw;
    height: 48px;
    background-color: var(--color-gray-50);
    z-index: 100;
    top: 70px;
    right: 0;
    left: unset;
    border-bottom: 2px solid var(--color-gray-100);
    position: absolute;

    button[title="Close"] {
        width: 15px;
        height: 15px;
        padding: 4px;
        margin: 0;

        svg {
            height: 15px;
        }
    }

    .form_group {
        width: 200px!important;
        height: 24px!important;

        input {
            opacity: 1;
        }

        label {
        top: -18px;
        background-color: var(--color-gray-50);
        }

        button {
            svg {
                fill: var(--color-brand-primary);
            }
        }
    }
}

.button {
    &_close {
        width: 20px;
        height: 20px;
    }

    &_arrow {
        fill: var(--color-gray-50);
        width: 15px;
        height: 10px;
    }
}

.Tts_popover_container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    height: fit-content;
    background-color: var(--color-gray-50);
    border-radius: 6px;
    list-style-type: none;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--color-gray-250);
    /* gap: 20px; */
    color: var(--color-text-primary);

    @media only screen and (width <= 980px) {
        max-height: 520px;
        overflow-y: auto;
        flex-wrap: wrap;
        max-width: 680px;
        gap: 5px;

        @include mx.scrollbar_styling;

/*
        .colorPicker div input {
            display: none;
        }
*/
    }


    .react_aria_ComboBox{
        .react_aria_Input {
            background-color: var(--color-neutral-base)!important;
            color: var(--color-text-primary)!important;
        }

        select {
            width: fit-content;
            height: 30px;
            border-radius: 6px;
            padding: 0 10px;
            background-color: var(--color-neutral-base);
            color: var(--color-text-primary);
        }

        .react_aria_ComboBox {
            margin: 0;
        }
    }

    .ttsSelectRate {
        .react_aria_ComboBox {
            margin-bottom: 5px;
            padding: 0;
        }
    }

    .ttsSelectVoice {
        margin-top: 2em;
        border: 2px dotted var(--color-gray-250);
        border-radius: 1em;
        padding: 0.4em;

        .react_aria_ComboBox {
            padding-bottom: 0;
        }
    }

    .ttsSelectRate, .ttsSelectVoice {
        input {
            padding-left: 10px;
        }

        .my_combobox_container {
            width: 280px;
        }
    }
}

.popover_arrow {
    border-top: 2px solid var(--color-gray-50);
    fill: var(--color-gray-50);
    width: 15px;
    height: 10px;
}

.bookmarkButton:focus + label {
    outline: var(--color-brand-primary) solid 2px !important;
    outline-offset: -2px;
}

#bookmarkLabel .bookmarkRemove{
    display: none;
    height: 24px;
    zoom: 1.2;
}

#bookmarkLabel .bookmarkIcon{
    display: block;
    zoom: 1.2;
}

#bookmarkLabel .bookmarkRemove,
#bookmarkLabel .bookmarkAdd{
    display: none;
}

#bookmarkLabel .bookmarkAdd{
    zoom: 0.6;
}

#bookmarkLabel .bookmarkRemove.active_svg_option,
#bookmarkLabel .bookmarkAdd.active_svg_option{
    display: block;
}

#bookmarkLabel:has(.bookmarkRemove.active_svg_option) .bookmarkIcon{
    display: none;
}

#bookmarkLabel:has(.bookmarkIcon.active_svg_option){
    background-color: var(--color-brand-primary) !important;
}

#bookmarkLabel:has(.bookmarkIcon.active_svg_option) .bookmarkRemove.active_svg_option,
#bookmarkLabel:has(.bookmarkIcon.active_svg_option) .bookmarkIcon.active_svg_option{
    color: var(--color-neutral-base) !important;
}

#bookmarkLabel:has(.bookmarkIcon.active_svg_option) .bookmarkAdd.active_svg_option{
    fill: var(--color-neutral-base) !important;
}

.annotationsIcon svg {
    width: 22px!important;
    height: 25px!important;
}

.searchHeader_container {
    display: flex;
    align-items: center;

    // padding: 20px 0;
    width: 400px;
    margin-right: 10%;

    .searchActions {
        display: flex;
        align-items: center;
        gap: 10px;

        &::before {
            content: "";
            position: absolute;
            margin-right: 10%;
            top: 47px;
            height: 1px;
            width: 200px;
            border-bottom: 2px solid var(--color-brand-primary);
        }
    }

    form::before {
        content: "";
        position: absolute;
        margin-right: 10%;
        top: 37px;
        height: 1px;
        width: 100%;
        border-bottom: 2px solid var(--color-brand-primary);
    }
}

.CSS_END_components_readerHeader {
    display: none;
}
